package com.ym.medical.enums;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.StdConverter;
import com.ym.common.annotations.EnumDescription;
import com.ym.common.constant.DictEnum;

/**
 * 订单结单状态
 */
@EnumDescription("订单结单状态")
public enum OrderFlowRecordSatusEnum implements DictEnum {

	//--------------------start-----------------

	/**
	 * 未抢单
	 */
	NOT_ROB_SINGLE("01","未抢单"),
	/**
	 * 已作废.患者主动作废
	 */
	THE_CANCELLATION("02","已作废.患者主动作废"),
	/**
	 * 已废弃，医生主动废弃
	 */
	HAVE_BEEN_ABANDONED("03","已废弃，医生主动废弃"),
	/**
	 * 已抢单
	 */
	HAS_SEIZED_THE_SINGLE("04","已抢单"),
	/**
	 * 转单
	 */
	TURN_THE_SINGLE("05","转单"),
	/**
	 * 已结单
	 */
	HAVE_STATEMENTS("06","已结单"),

	//--------------------end-------------------
	;

	private String key;

	private String value;

	OrderFlowRecordSatusEnum(String key, String value) {
		this.key = key;
		this.value = value;
	}

	@Override
	public String getKey() {
		return this.key;
	}

	@Override
	public String getValue() {
		return this.value;
	}


	/**
	 * 序列化使用
	 */
	public static class Covert extends StdConverter<String, JSONObject> {
		@Override
		public JSONObject convert(String value) {
			return DictEnum.valueOfJson(OrderFlowRecordSatusEnum.class, value);
		}
	}
}
